import {useCookies} from "@vueuse/integrations/useCookies";

const cookie = useCookies()

// ============================== Token 令牌 ==============================
//存储在cookie中的token的key
const  TOKEN_KEY = 'Authorization'

//获取token
export  function  getToken(){
    return cookie.get(TOKEN_KEY)
}

//设置Token到cookie中
export function setToken(token){
    return cookie.set(TOKEN_KEY,token)
}
//删除token
export function removeToken(token){
    return cookie.remove(TOKEN_KEY)
}

// ============================== 标签页 ==============================

const  TAB_LIST_KEY = 'tabList'
//获取TabList
export function getTabList(){
    return cookie.get(TAB_LIST_KEY)
}

//存储tabList
export function setTabList(tabList){
    return cookie.set(TAB_LIST_KEY,tabList)
}